/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package peticionweb.logica.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author icardenas
 */
@Entity
@Table(name="cucar1m")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cucar1m.findAll", query = "SELECT c FROM Cucar1m c")})
public class Cucar1m implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer codca;
    @Basic(optional = false)
    @Column(nullable = false, length = 40)
    private String nomca;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cucar1m", fetch = FetchType.LAZY)
    private List<Cupar1a> cupar1aList;

    public Cucar1m() {
    }

    public Cucar1m(Integer codca) {
        this.codca = codca;
    }

    public Cucar1m(Integer codca, String nomca) {
        this.codca = codca;
        this.nomca = nomca;
    }

    public Integer getCodca() {
        return codca;
    }

    public void setCodca(Integer codca) {
        this.codca = codca;
    }

    public String getNomca() {
        return nomca;
    }

    public void setNomca(String nomca) {
        this.nomca = nomca;
    }

    @XmlTransient
    public List<Cupar1a> getCupar1aList() {
        return cupar1aList;
    }

    public void setCupar1aList(List<Cupar1a> cupar1aList) {
        this.cupar1aList = cupar1aList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codca != null ? codca.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cucar1m)) {
            return false;
        }
        Cucar1m other = (Cucar1m) object;
        if ((this.codca == null && other.codca != null) || (this.codca != null && !this.codca.equals(other.codca))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "peticionweb.logica.entidad.Cucar1m[ codca=" + codca + " ]";
    }
    
}
